/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.webproject.servlet;

import java.util.StringTokenizer;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 *
 * @author jeong
 */
public class JdbcDriver extends HttpServlet {

    public void init(ServletConfig config) throws ServletException {
        
        try {
            
            String drivers = config.getInitParameter("jdbcdriver");
            StringTokenizer st = new StringTokenizer(drivers, ",");
            while (st.hasMoreTokens()) {
                String jdbcDriver = st.nextToken();
                Class.forName(jdbcDriver);
            }
            
        } catch(Exception ex) {
            throw new ServletException(ex);
        }
    } 

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>
}
